const baseConf = require('./webpack.common.js');
const { merge } = require('webpack-merge');
const path = require('path');

// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = merge(baseConf, {
  mode: 'production',
  output: {
    filename: 'bundle.[contenthash:8].js',
    path: path.resolve(__dirname, 'dist'),
    clean: true
  },
  module: {
    rules: [
      {
        test: /\.(png|jpg|svg)$/,
        type: 'asset'
      }
    ]
  },
  plugins: [
    // new BundleAnalyzerPlugin()
  ]
})